package pl.diagnoser.client.dto;

import com.google.gwt.user.client.rpc.IsSerializable;

public class DefectDictDTO implements IsSerializable, Comparable<DefectDictDTO> {

	private String defectName;
	private double defectConfidence = 0.0;

	public DefectDictDTO() {}
	public DefectDictDTO( String illnessName ) {
		this.defectName = illnessName;
	}
	public DefectDictDTO( String illnessName, double illnessConfidence ) {
		this.defectName = illnessName;
		this.defectConfidence = illnessConfidence;
	}

	public String getDefectName() {
		return defectName;
	}

	public void setDefectName( String defectName ) {
		this.defectName = defectName;
	}

	public double getDefectConfidence() {
		return this.defectConfidence;
	}

	public void setDefectConfidence( double defectConfidence ) {
		this.defectConfidence = defectConfidence;
	}

	public int compareTo(DefectDictDTO defect) {
		return Double.compare(defectConfidence, defect.getDefectConfidence());
	}

	public String toString() {
		String defect = "<defect_name>" + this.getDefectName() + "</defect_name>";
		defect += "<defect_confidence>" + this.getDefectConfidence() + "</defect_confidence>";
		return defect;
	}
}